import { stringify } from 'qs';
import request from '@/utils/request';

import webpath from '@/utils/webpath';

export async function deleteByPrimaryKeyForProMenuAuth(params = {}) {

    return request(`/hrath/web/api/service/promenuauth/delete?${stringify(params)}`);

}


export async function selectByPrimaryKeyForProMenuAuth(params = {}) {

    return request(`/hrath/web/api/service/promenuauth/get?${stringify(params)}`);
}


export async function insertForProMenuAuth(params = {}) {

    return request(`/hrath/web/api/service/promenuauth/insert`, {

        method: 'POST',
        data: {
            ...params,
            method: 'insert',
        },
    });
}


export async function updateForProMenuAuth(params = {}) {

    return request(`/hrath/web/api/service/promenuauth/update`, {
        method: 'POST',
        data: {
            ...params,
            method: 'update',
        },
    });
}


export async function deleteByMapForProMenuAuth(params = {}) {

    return request(`/hrath/web/api/service/promenuauth/deleteByMap`, {

        method: 'POST',
        data: {
            ...params,
            method: 'delete',
        },
    });
}


export async function updateByMapForProMenuAuth(params = {}) {

    return request(`/hrath/web/api/service/promenuauth/updateByMap`, {

        method: 'POST',
        data: {
            ...params,
            method: 'update',
        },
    });
}


export async function getOneForProMenuAuth(params = {}) {

    return request(`/hrath/web/api/service/promenuauth/getOne`, {

        method: 'POST',
        data: {
            ...params,
            method: 'fetch',
        },
    });
}



export async function getAllForProMenuAuth(params = {}) {

    return request(`/hrath/web/api/service/promenuauth/getAll`, {

        method: 'POST',
        data: {
            ...params,
            method: 'fetch',
        },
    });
}


export async function queryPageForProMenuAuth(params = {}) {

    return request(`/hrath/web/api/service/proauthority/queryPage`, {

        method: 'POST',
        data: {
            ...params,
            method: 'fetch',
        },
    });
}

export async function countForProMenuAuth(params = {}) {

    return request(`/hrath/web/api/service/promenuauth/count`, {

        method: 'POST',
        data: {
            ...params,
            method: 'fetch',
        },
    });
}

export async function insertBatchForProMenuAuth(params = {}) {

    return request(`/hrath/web/api/service/promenuauth/insertBatch`, {

        method: 'POST',
        data: {
            ...params,
            method: 'insert',
        },
    });
}


export async function deleteBatchForProMenuAuth(params = {}) {

    return request(`/hrath/web/api/service/promenuauth/deleteBatch`, {
        method: 'POST',
        data: {
            ...params,
            method: 'delete',
        },
    });
}


export async function updateBatchForProMenuAuth(params = {}) {

    return request(`/hrath/web/api/service/promenuauth/updateBatch`, {
        method: 'POST',
        data: {
            ...params,
            method: 'update',
        },
    });
}




export async function getAllMenuTreeByAuthID(params = {}) {

    return request(`/hrath/web/api/service/promenuauth/getAllMenuTreeByAuthID`, {

        method: 'POST',
        data: {
            ...params,
            method: 'fetch',
        },
    });
}

export async function getProMenuTreeByLevelCode(params = {}) {

    return request(`/hrath/web/api/service/promenu/getProMenuTreeByLevelCode`, {

        method: 'POST',
        data: {
            ...params,
            method: 'fetch',
        },
    });
}

export async function getPageAuthByMenuTreeId(params = {}) {

    return request(`/hrath/web/api/service/promenuauth/getPageAuthByMenuTreeId`, {

        method: 'POST',
        data: {
            ...params,
            method: 'fetch',
        },
    });
}

export async function queryPageForProAuthority(params = {}) {

    return request(`/hrath/web/api/service/proauthority/queryPage`, {
        method: 'POST',
        data: {
            ...params,
            method: 'fetch',
        },
    });
}

export async function insertForProMenu(params = {}) {

    return request(`/hrath/web/api/service/promenu/insert`, {
        method: 'POST',
        data: {
            ...params,
            method: 'insert',
        },
    });
}

export async function updateForProMenu(params = {}) {

    return request(`/hrath/web/api/service/promenu/update`, {
        method: 'POST',
        data: {
            ...params,
            method: 'update',
        },
    });
}

export async function deleteByPrimaryKeyForProMenu(params = {}) {

    return request(`/hrath/web/api/service/promenu/delete?${stringify(params)}`);
}

export async function updateChangeTargetNodeWithSourceNodeForProMenu(params = {}) {
    return request(`/hrath/web/api/service/promenuauth/updateChangeTargetNodeWithSourceNodeForProMenu`, {

        method: 'POST',
        data: {
            ...params,
            method: 'update',
        },
    });
}

export async function deleteByPrimaryKeyForProAuthority(params = {}) {

    return request(`/hrath/web/api/service/proauthority/delete?${stringify(params)}`);

}


export async function insertForProAuthority(params = {}) {

    return request(`/hrath/web/api/service/proauthority/insert`, {
        method: 'POST',
        data: {
            ...params,
            method: 'insert',
        },
    });
}


export async function updateForProAuthority(params = {}) {

    return request(`/hrath/web/api/service/proauthority/update`, {
        method: 'POST',
        data: {
            ...params,
            method: 'update',
        },
    });
}

export async function getAllMenuTreeByAuthIDForDeleteTree(params = {}) {

    return request(`/hrath/web/api/service/promenuauth/getAllMenuTreeByAuthIDForDeleteTree`, {
        method: 'POST',
        data: {
            ...params,
            method: 'fetch',
        },
    });
}
